package jjn.round2;

/**
 * @author Jiang Jining
 * @since 2023-05-03 14:34
 */
public class Offer50_FirstUniqueChar {
    public char firstUniqChar(String s) {
        int[] count = new int[26];
        for (char c : s.toCharArray()) {
            count[c - 'a']++;
        }
        for (char c : s.toCharArray()) {
            if (count[c - 'a'] == 1) {
                return c;
            }
        }
        return ' ';
    }
}
